Q: From where does a netboot server (bootpd) get its “served kernel” information?\
\
A: The netboot server gets its kernel information from
\b two
\b0 sources:\
\
• NetInfo and\
•
\f0 /etc/bootptab
\f2 .\
\
(Yes, from both. Even if NetInfo is running, the file is consulted.)\
\
There are two types of bootpd information: global (i.e., for all netboot clients) and local (i.e., for a specific client). The global information is read from the file\
\
\f0 /etc/bootptab
\f2 ;\
\
the local information comes from NetInfo (the /machines/
\i client
\i0 directory).\
\
There are two pieces of global information: the tftpboot root directory, and the default kernel to be served. [What's
\i tftpboot
\i0 ? It's the file transfer mechanism used for netbooting —
\i t
\i0 rivial
\i f
\i0 ile
\i t
\i0 ransfer
\i p
\i0 rotocol
\i boot
\i0 .] All kernels which can be booted must be located in the tftpboot root directory, which is typically\
\
\f0 /private/tftpboot
\f2 \
\
on our system. Any pathname given, either for the default kernel or for a per-client kernel, is relative to the tftpboot root directory; further, that directory is considered as the root directory for the tftpboot process, so a path like\
\
\f0 /sdmach\
\
\f2 will be interpreted as\
\
\f0 /private/tftpboot/sdmach
\f2 .\
\
(Why is this done? Security: it prevents booting arbitrary files from the boot server.)\
\
Then there's the local information: a host type, ethernet address, IP address, and bootfile. These are all obtained from NetInfo. Note that, although the host type appears in
\f0 bootptab
\f2 , it is not present in NetInfo; if an
\f0 niload
\f2 (8) is done, it
\b\fs22 MUST
\b0\fs24 have the value 1 (else
\f0 niload
\f2 will yield an error). If you
\f0 nidump bootptab
\f2 , a 1 will be provided in the field.\
\
Now, the stage is set for explaining how the netboot sequence occurs, regarding the boot protocol.\
\
The following paragraph describes the boot sequence from the server's perspective:\
\
1. A client sends a
\fs22 BOOTP
\fs24 broadcast, asking for the file “
\f0 boot
\f2 ” (the name is in the
\fs22 PROM
\fs24 ). This is the\
request for the “blk0 loader,” also known as the “bootstrap loader.” The server notices same.\
2. The server then checks in NetInfo to determine if the ethernet address in the
\fs22 BOOTP
\fs24 request is known.\
The NetInfo hierarchy is searched, starting with the local domain, looking for a
\b /machines
\b0 entry with\
an
\b en_address
\b0 property whose value matches the address of the broadcaster.\
3. If the ethernet address is known, the server responds to the client with information including the path to\
the bootstrap loader. This path is comprised of two components: the directory, and the file name. The\
directory is determined from
\f0 /etc/bootptab
\f2 (yes, even if NetInfo is running); this is the “tftpboot\
root” directory. The file name was specified by the broadcaster (the client) in 1, above, as
\f0 boot
\f2 .\
4. A request from the client to transfer the bootstrap loader is received; the loader is sent back, using
\fs22 TFTP
\fs24 .\
5. Another
\fs22 BOOTP
\fs24 request is received, this time for the pathname to the kernel. The path is sent, determined from\
a combination of NetInfo and
\f0 /etc/bootptab
\f2 . Specifically, the tftpboot root directory (at the top\
of the tree from which kernels can be obtained) is found in
\f0 bootptab
\f2 , as is the default kernel to be\
sent. The kernel to be sent can be overridden in NetInfo: the
\b bootfile
\b0 property in the client's directory\
in the /machines directory specifies this. (Domains are searched on the server, starting with the\
server's local [.] domain, continuing up the NetInfo domain hierarchy.) It can also be overridden by\
the client, in the boot command specified [e.g., ben()new_mach]; note that any explicit path given for\
a kernel will be relative to the tftpboot root directory.\
\
Transfer of the kernel, using TFTP, completes this phase of the boot sequence.\
\
One other note. This notion of “tftpboot root” is a bit unusual. A
\f0 chroot
\f2 (2) is only effected during the actual transfer. If a path such as
\f0 ../MyMach
\f2 (e.g.,
\f0 ben ../MyMach
\f2 ) is given for the kernel, strange things will result. Specifically (assuming the normal tftpboot root)
\f0 /private/MyMach
\f2 (that is,
\f0 /private/tftpboot/../MyMach
\f2 ) must exist, and
\f0 MyMach
\f2 must exist in the tftpboot root directory. It is the latter of these which will actually be
\fs22 TFTP
\fs24 ed to the client. Note also that the kernel file name shouldn't have any dash characters (-) in it: the dash is used by the
\fs22 PROM
\fs24 's boot command to denote arguments to be passed to the booted kernel.\
\gray333 \
QA369\
\gray0 \
\pard\tx520\tx1060\tx1600\tx2120\tx2660\tx3200\tx3720\tx4260\tx4800\tx5320 Valid for 1.0\